<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>使用location对象重新加载与替换网页</title>
</head>
<body>
  <input type="button" value="加载W3C" onclick="location.assign('https://www.w3.org/')">
  <br>
  <input type="button" value="重新加载本页面" onclick="location.reload()">
  <br>
  <input type="button" value="将本页面替换为W3C" onclick="location.replace('https://www.w3.org/')">
  <br>
</body>
</html>